package inc.gome.dynamic.datasource.dynamic;

import org.jclouds.Fallbacks;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.ParamParser;
import org.jclouds.rest.annotations.RequestFilters;

import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.MediaType;


@Path("/")
public interface JobsApi {


    @Named("jobs:pipeline-node")
    @Path("cicd/v1/run/detail/{name}/{number}/{nodeId}")
    @Fallback(Fallbacks.NullOnNotFoundOr404.class)
    @Consumes(MediaType.APPLICATION_JSON)
    @GET
    PipelineNode pipelineNode(
        @PathParam("name") String jobName,
        @PathParam("number") int buildNumber, @PathParam("nodeId") int nodeId);


    @Named("jobs:pipeline-node")
    @Path("purchase/commit")
    @Fallback(Fallbacks.NullOnNotFoundOr404.class)
    @GET
    String purchase();


}
